// 全局样式文件

// 颜色变量
:root {
  --primary-color: #165DFF;
  --secondary-color: #36CFC9;
  --success-color: #52C41A;
  --warning-color: #FAAD14;
  --danger-color: #FF4D4F;
  --info-color: #1890FF;
  
  --neutral-100: #F5F7FA;
  --neutral-200: #E5E6EB;
  --neutral-300: #C9CDD4;
  --neutral-400: #86909C;
  --neutral-500: #4E5969;
  --neutral-600: #272E3B;
  --neutral-700: #1D2129;
  
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --box-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
}

// 重置样式
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Inter', 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--neutral-700);
  background-color: var(--neutral-100);
}

// 滚动条样式
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--neutral-200);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: var(--neutral-400);
  border-radius: 3px;
  
  &:hover {
    background: var(--neutral-500);
  }
}

// 工具类
.flex {
  display: flex;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col {
  display: flex;
  flex-direction: column;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.w-full {
  width: 100%;
}

.h-full {
  height: 100%;
}

.min-h-screen {
  min-height: 100vh;
}

// 过渡动画
.transition-all {
  transition: all 0.3s ease;
}

.transition-colors {
  transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

.transition-transform {
  transition: transform 0.3s ease;
}

// 卡片样式
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 20px;
  
  &.card-hover {
    transition: all 0.3s ease;
    
    &:hover {
      box-shadow: var(--box-shadow-hover);
      transform: translateY(-2px);
    }
  }
}

// 按钮样式
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  
  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }
  
  &.btn-primary {
    background-color: var(--primary-color);
    color: white;
    
    &:hover:not(:disabled) {
      background-color: #0E42D2;
    }
  }
  
  &.btn-secondary {
    background-color: var(--neutral-200);
    color: var(--neutral-700);
    
    &:hover:not(:disabled) {
      background-color: var(--neutral-300);
    }
  }
  
  &.btn-danger {
    background-color: var(--danger-color);
    color: white;
    
    &:hover:not(:disabled) {
      background-color: #D32F2F;
    }
  }
  
  &.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  &.btn-lg {
    padding: 12px 24px;
    font-size: 16px;
  }
}

// 输入框样式
.input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--neutral-300);
  border-radius: var(--border-radius);
  font-size: 14px;
  transition: border-color 0.3s ease;
  
  &:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(22, 93, 255, 0.1);
  }
  
  &::placeholder {
    color: var(--neutral-400);
  }
}

// 标签样式
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  
  &.badge-primary {
    background-color: rgba(22, 93, 255, 0.1);
    color: var(--primary-color);
  }
  
  &.badge-success {
    background-color: rgba(82, 196, 26, 0.1);
    color: var(--success-color);
  }
  
  &.badge-warning {
    background-color: rgba(250, 173, 20, 0.1);
    color: var(--warning-color);
  }
  
  &.badge-danger {
    background-color: rgba(255, 77, 79, 0.1);
    color: var(--danger-color);
  }
}

// 响应式工具类
@media (max-width: 768px) {
  .hidden-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hidden-desktop {
    display: none !important;
  }
}

// NProgress样式覆盖
#nprogress .bar {
  background: var(--primary-color) !important;
}

#nprogress .peg {
  box-shadow: 0 0 10px var(--primary-color), 0 0 5px var(--primary-color) !important;
}

#nprogress .spinner-icon {
  border-top-color: var(--primary-color) !important;
  border-left-color: var(--primary-color) !important;
}